﻿@if(Request.IsAuthenticated) {
    string Display=User.Identity.Name;
    MvcHtmlString Messages = new MvcHtmlString("");
    if (smsgs_MVC3.Utils.SiteUtils.UserLoggedOn != null)
    {
        int i = smsgs_MVC3.Utils.SiteUtils.RetrieveMessagesUnreadCount(smsgs_MVC3.Utils.SiteUtils.UserLoggedOn.Key);

        if (i > 0)
        {
            Messages = Html.ActionLink("New msg:"+i , "Index", "Msg", new { Area = "Messages" },null); ;
        }
        else
        {
            Messages = Html.ActionLink("Inbox", "Index", "Msg", new { Area = "Messages" }, null); 
        }
           
    }
    <text>Welcome <strong>@Display (@Messages)</strong>! 
    [ @Html.ActionLink("Log Off", "LogOff", "Account", new { Area = "" }, null) ]</text>
    
}
else {
    @:[ @Html.ActionLink("Log On", "LogOn", "Account", new { Area = "" }, null) ]
}
